package com.act;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.KeyEvent;

import com.umeng.analytics.MobclickAgent;
import com.xike.kyt.R;

public class StartAct extends BaseAct {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.act_start);
		hander.sendEmptyMessageDelayed(0, 2000);
	}

	Handler hander = new Handler() {

		@Override
		public void handleMessage(Message msg) {
			startActivity(new Intent(StartAct.this, MainAct.class));
			// if (MyUtil.isLogined()) {
			// startActivity(new Intent(StartAct.this, MainAct.class));
			// } else {
			// MyUtil.logout();
			// startActivity(new Intent(StartAct.this, LoginAct.class));
			// }
			finish();
			super.handleMessage(msg);
		}

	};

	@Override
	public boolean dispatchKeyEvent(KeyEvent event) {

		if (event.getKeyCode() == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
			System.exit(0);
			return true;
		}
		return super.dispatchKeyEvent(event);
	}

	@Override
	protected void initViews() {
	}

	@Override
	protected void updateViews() {

	}

}
